package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   卡券包<br>
 *<br>
 * 数据表： card_voucher_package
 *
 */
@Description({"卡券包"})
public class CardVoucherPackage implements Serializable {
    /**
     *
     *   卡券Id    <br>
     *<br>
     * 字段名： card_voucher_package.CardVoucherId
     */
    @Description({"卡券Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer cardVoucherId;

    /**
     *
     *   用户Id    <br>
     *<br>
     * 字段名： card_voucher_package.UserId
     */
    @Description({"用户Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer userId;

    /**
     *
     *   订单Id    <br>
     *<br>
     * 字段名： card_voucher_package.OrderId
     */
    @Description({"订单Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer orderId;

    /**
     *
     *   产品Id    <br>
     *<br>
     * 字段名： card_voucher_package.ProductId
     */
    @Description({"产品Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer productId;

    /**
     *
     *   订单详情Id    <br>
     *<br>
     * 字段名： card_voucher_package.OrderDetailId
     */
    @Description({"订单详情Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer orderDetailId;

    /**
     *
     *   折扣类型;充值/抵用券/礼品卡    <br>
     *<br>
     * 字段名： card_voucher_package.DiscountMode
     */
    @Description({"折扣类型;充值/抵用券/礼品卡", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer discountMode;

    /**
     *
     *   卡号/券号(充值不存在)    <br>
     *<br>
     * 字段名： card_voucher_package.VoucherNumber
     */
    @Description({"卡号/券号(充值不存在)", "不能为空", "数据长度: 190"})
    @NonNull
    private String voucherNumber;

    /**
     *
     *   卡pin/券密    <br>
     *<br>
     * 字段名： card_voucher_package.VoucherPass
     */
    @Description({"卡pin/券密", "数据长度: 190"})
    private String voucherPass;

    /**
     *
     *   有效日期    <br>
     *<br>
     * 字段名： card_voucher_package.Effectivetime
     */
    @Description({"有效日期", "数据长度: 26"})
    private Date effectivetime;

    /**
     *
     *   失效日期    <br>
     *<br>
     * 字段名： card_voucher_package.Expiretime
     */
    @Description({"失效日期", "数据长度: 26"})
    private Date expiretime;

    /**
     *
     *   状态;未使用;已使用;已过期    <br>
     *<br>
     * 字段名： card_voucher_package.Status
     */
    @Description({"状态;未使用;已使用;已过期", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer status;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： card_voucher_package.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： card_voucher_package.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： card_voucher_package.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： card_voucher_package.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： card_voucher_package.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   卡券Id    <br>
     *<br>
     * 字段名： card_voucher_package.CardVoucherId
     */
    public Integer getCardVoucherId() {
        return cardVoucherId;
    }

    /**
     * 设置参数<br><br>
     *
     *   卡券Id<br>
     *<br>
     * 字段名： card_voucher_package.CardVoucherId
     */
    public void setCardVoucherId(Integer cardVoucherId) {
        this.cardVoucherId = cardVoucherId;
    }

    /**
     * 获取参数<br><br>
     *
     *   用户Id    <br>
     *<br>
     * 字段名： card_voucher_package.UserId
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置参数<br><br>
     *
     *   用户Id<br>
     *<br>
     * 字段名： card_voucher_package.UserId
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取参数<br><br>
     *
     *   订单Id    <br>
     *<br>
     * 字段名： card_voucher_package.OrderId
     */
    public Integer getOrderId() {
        return orderId;
    }

    /**
     * 设置参数<br><br>
     *
     *   订单Id<br>
     *<br>
     * 字段名： card_voucher_package.OrderId
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     * 获取参数<br><br>
     *
     *   产品Id    <br>
     *<br>
     * 字段名： card_voucher_package.ProductId
     */
    public Integer getProductId() {
        return productId;
    }

    /**
     * 设置参数<br><br>
     *
     *   产品Id<br>
     *<br>
     * 字段名： card_voucher_package.ProductId
     */
    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    /**
     * 获取参数<br><br>
     *
     *   订单详情Id    <br>
     *<br>
     * 字段名： card_voucher_package.OrderDetailId
     */
    public Integer getOrderDetailId() {
        return orderDetailId;
    }

    /**
     * 设置参数<br><br>
     *
     *   订单详情Id<br>
     *<br>
     * 字段名： card_voucher_package.OrderDetailId
     */
    public void setOrderDetailId(Integer orderDetailId) {
        this.orderDetailId = orderDetailId;
    }

    /**
     * 获取参数<br><br>
     *
     *   折扣类型;充值/抵用券/礼品卡    <br>
     *<br>
     * 字段名： card_voucher_package.DiscountMode
     */
    public Integer getDiscountMode() {
        return discountMode;
    }

    /**
     * 设置参数<br><br>
     *
     *   折扣类型;充值/抵用券/礼品卡<br>
     *<br>
     * 字段名： card_voucher_package.DiscountMode
     */
    public void setDiscountMode(Integer discountMode) {
        this.discountMode = discountMode;
    }

    /**
     * 获取参数<br><br>
     *
     *   卡号/券号(充值不存在)    <br>
     *<br>
     * 字段名： card_voucher_package.VoucherNumber
     */
    public String getVoucherNumber() {
        return voucherNumber;
    }

    /**
     * 设置参数<br><br>
     *
     *   卡号/券号(充值不存在)<br>
     *<br>
     * 字段名： card_voucher_package.VoucherNumber
     */
    public void setVoucherNumber(String voucherNumber) {
        this.voucherNumber = voucherNumber == null ? null : voucherNumber.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   卡pin/券密    <br>
     *<br>
     * 字段名： card_voucher_package.VoucherPass
     */
    public String getVoucherPass() {
        return voucherPass;
    }

    /**
     * 设置参数<br><br>
     *
     *   卡pin/券密<br>
     *<br>
     * 字段名： card_voucher_package.VoucherPass
     */
    public void setVoucherPass(String voucherPass) {
        this.voucherPass = voucherPass == null ? null : voucherPass.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   有效日期    <br>
     *<br>
     * 字段名： card_voucher_package.Effectivetime
     */
    public Date getEffectivetime() {
        return effectivetime;
    }

    /**
     * 设置参数<br><br>
     *
     *   有效日期<br>
     *<br>
     * 字段名： card_voucher_package.Effectivetime
     */
    public void setEffectivetime(Date effectivetime) {
        this.effectivetime = effectivetime;
    }

    /**
     * 获取参数<br><br>
     *
     *   失效日期    <br>
     *<br>
     * 字段名： card_voucher_package.Expiretime
     */
    public Date getExpiretime() {
        return expiretime;
    }

    /**
     * 设置参数<br><br>
     *
     *   失效日期<br>
     *<br>
     * 字段名： card_voucher_package.Expiretime
     */
    public void setExpiretime(Date expiretime) {
        this.expiretime = expiretime;
    }

    /**
     * 获取参数<br><br>
     *
     *   状态;未使用;已使用;已过期    <br>
     *<br>
     * 字段名： card_voucher_package.Status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置参数<br><br>
     *
     *   状态;未使用;已使用;已过期<br>
     *<br>
     * 字段名： card_voucher_package.Status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： card_voucher_package.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： card_voucher_package.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： card_voucher_package.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： card_voucher_package.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： card_voucher_package.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： card_voucher_package.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： card_voucher_package.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： card_voucher_package.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： card_voucher_package.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： card_voucher_package.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        cardVoucherId("CardVoucherId", "cardVoucherId", "INTEGER", false),
        userId("UserId", "userId", "INTEGER", false),
        orderId("OrderId", "orderId", "INTEGER", false),
        productId("ProductId", "productId", "INTEGER", false),
        orderDetailId("OrderDetailId", "orderDetailId", "INTEGER", false),
        discountMode("DiscountMode", "discountMode", "INTEGER", false),
        voucherNumber("VoucherNumber", "voucherNumber", "VARCHAR", false),
        voucherPass("VoucherPass", "voucherPass", "VARCHAR", false),
        effectivetime("Effectivetime", "effectivetime", "TIMESTAMP", false),
        expiretime("Expiretime", "expiretime", "TIMESTAMP", false),
        status("Status", "status", "INTEGER", true),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}